package edu.sctu.alex.June.day20150614;

import java.io.*;

/**
 * Created by alex on 2015/6/14.
 */
public class ReaderUtil {

    FileWriter fileWriter;
    FileReader fileReader;

    public void testReader(){
        int ch = 0;
        char[] chars = new char[1024];

        File file = new File("F:\\alex/yangxu.txt");

        try {
            fileReader = new FileReader(file);
            fileWriter = new FileWriter("F:\\alex/yangxu1.txt");

            while((ch = fileReader.read(chars))!=-1){
                fileWriter.write(chars,0,ch);
                System.out.println(chars);
            }
            fileWriter.close();
            fileReader.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
